<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="前端,html5,css5">
    <meta name="description" content="HTML5将Web带入一个成熟的应用平台，在这个平台上，视频、音频、图像、动画以及与设备的交互都进行了规范。">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>HTML5CSS3 | 小沈曰</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">

    <script src="/libs/jquery/jquery.min.js"></script>
    
<meta name="generator" content="Hexo 4.2.0"><link rel="alternate" href="/xiaoshensay/atom.xml" title="小沈曰" type="application/atom+xml">
<link rel="stylesheet" href="/xiaoshensay/css/prism-tomorrow.css" type="text/css"></head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/xiaoshensay/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">小沈曰</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="" class="waves-effect waves-light">

      
      <i class="fas fa-list" style="zoom: 0.6;"></i>
      
      <span>Medias</span>
      <i class="fas fa-chevron-down" aria-hidden="true" style="zoom: 0.6;"></i>
    </a>
    <ul class="sub-nav menus_item_child ">
      
      <li>
        <a href="/xiaoshensay/musics">
          
          <i class="fas fa-music" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>Musics</span>
        </a>
      </li>
      
      <li>
        <a href="/xiaoshensay/movies">
          
          <i class="fas fa-film" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>Movies</span>
        </a>
      </li>
      
      <li>
        <a href="/xiaoshensay/books">
          
          <i class="fas fa-book" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>Books</span>
        </a>
      </li>
      
      <li>
        <a href="/xiaoshensay/galleries">
          
          <i class="fas fa-image" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>Galleries</span>
        </a>
      </li>
      
    </ul>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>

<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">小沈曰</div>
        <div class="logo-desc">
            
            计算机,读书,菜谱,旅游,宠物
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="javascript:;">
			
				<i class="fa-fw fas fa-list"></i>
			
			Medias
			<span class="m-icon"><i class="fas fa-chevron-right"></i></span>
		</a>
            <ul  style="background:  ;" >
              
                <li>   
				
                  <a href="/xiaoshensay/musics " style="margin-left:75px";>
				  
				   <i class="fa fas fa-music" style="position: absolute;left:50px" ></i>
			      
		          <span>Musics</span>
                  </a>
                </li>
              
                <li>   
				
                  <a href="/xiaoshensay/movies " style="margin-left:75px";>
				  
				   <i class="fa fas fa-film" style="position: absolute;left:50px" ></i>
			      
		          <span>Movies</span>
                  </a>
                </li>
              
                <li>   
				
                  <a href="/xiaoshensay/books " style="margin-left:75px";>
				  
				   <i class="fa fas fa-book" style="position: absolute;left:50px" ></i>
			      
		          <span>Books</span>
                  </a>
                </li>
              
                <li>   
				
                  <a href="/xiaoshensay/galleries " style="margin-left:75px";>
				  
				   <i class="fa fas fa-image" style="position: absolute;left:50px" ></i>
			      
		          <span>Galleries</span>
                  </a>
                </li>
               
            </ul>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/stszl" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>

        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/stszl" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    
<script src="/libs/cryptojs/crypto-js.min.js"></script>
<script>
    (function() {
        let pwd = '';
        if (pwd && pwd.length > 0) {
            if (pwd !== CryptoJS.SHA256(prompt('请输入访问本文章的密码')).toString(CryptoJS.enc.Hex)) {
                alert('密码错误，将返回主页！');
                location.href = '/xiaoshensay/';
            }
        }
    })();
</script>




<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/2.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">HTML5CSS3</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        height: calc(100vh - 250px);
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #toc-content .is-active-link::before {
        background-color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/xiaoshensay/tags/HTML5/">
                                <span class="chip bg-color">HTML5</span>
                            </a>
                        
                            <a href="/xiaoshensay/tags/CSS3/">
                                <span class="chip bg-color">CSS3</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/xiaoshensay/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA/" class="post-category">
                                计算机
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2019-05-01
                </div>
                

                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    4k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    16 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>

        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <h1 id="HTML5CSS3"><a href="#HTML5CSS3" class="headerlink" title="HTML5CSS3"></a>HTML5CSS3</h1><h2 id="一、什么是-HTML5"><a href="#一、什么是-HTML5" class="headerlink" title="一、什么是 HTML5"></a>一、什么是 <code>HTML5</code></h2><h3 id="1-HTML5-的概念与定义"><a href="#1-HTML5-的概念与定义" class="headerlink" title="1. HTML5 的概念与定义"></a>1. <code>HTML5</code> 的概念与定义</h3><ul>
<li>定义：<code>HTML5</code> 定义了 <code>HTML</code> 标准的最新版本，是对 <code>HTML</code> 的第五次重大修改，号称下一代的 <code>HTML</code> </li>
<li>两个概念：<ul>
<li>是一个新版本的 <code>HTML</code> 语言，定义了新的标签、特性和属性</li>
<li>拥有一个强大的技术集，这些技术集是指： <code>HTML5</code> 、<code>CSS3</code> 、<code>javascript</code>, 这也是广义上的 <code>HTML5</code></li>
</ul>
</li>
</ul>
<h3 id="2-HTML5-拓展了哪些内容"><a href="#2-HTML5-拓展了哪些内容" class="headerlink" title="2. HTML5 拓展了哪些内容"></a>2. <code>HTML5</code> 拓展了哪些内容</h3><ul>
<li>语义化标签</li>
<li>本地存储</li>
<li>兼容特性</li>
<li><code>2D</code>、<code>3D</code> </li>
<li>动画、过渡</li>
<li><code>CSS3</code> 特性</li>
<li>性能与集成</li>
</ul>
<h3 id="3-HTML5-的现状"><a href="#3-HTML5-的现状" class="headerlink" title="3. HTML5 的现状"></a>3. <code>HTML5</code> 的现状</h3><p>绝对多数新的属性，都已经被浏览器所支持，最新版本的浏览器已经开始陆续支持最新的特性，<br>总的来说：<code>HTML5</code> 已经是大势所趋</p>
<h2 id="二、HTML5-新增标签"><a href="#二、HTML5-新增标签" class="headerlink" title="二、HTML5 新增标签"></a>二、<code>HTML5</code> 新增标签</h2><h3 id="1-什么是语义化"><a href="#1-什么是语义化" class="headerlink" title="1. 什么是语义化"></a>1. 什么是语义化</h3><blockquote>
<p>用最恰当的标签来标记内容</p>
</blockquote>
<h3 id="2-新增了那些语义化标签"><a href="#2-新增了那些语义化标签" class="headerlink" title="2. 新增了那些语义化标签"></a>2. 新增了那些语义化标签</h3><ul>
<li><code>header</code>   —  头部标签</li>
<li><code>nav</code>       —  导航标签</li>
<li><code>article</code> —   内容标签</li>
<li><code>section</code> —   块级标签</li>
<li><code>aside</code>    —   侧边栏标签</li>
<li><code>footer</code>   —   尾部标签</li>
</ul>
<img width="80%" src="images\yuyibq.png">

<h3 id="3-使用语义化标签的注意"><a href="#3-使用语义化标签的注意" class="headerlink" title="3. 使用语义化标签的注意"></a>3. 使用语义化标签的注意</h3><ul>
<li>语义化标签主要针对搜索引擎</li>
<li>新标签可以使用一次或者多次</li>
<li>在 <code>IE9</code> 浏览器中，需要把语义化标签都转换为块级元素</li>
<li>语义化标签，在移动端支持比较友好，</li>
<li>另外，<code>HTML5</code> 新增的了很多的语义化标签，随着课程深入，还会学习到其他的</li>
</ul>
<h2 id="三、多媒体音频标签"><a href="#三、多媒体音频标签" class="headerlink" title="三、多媒体音频标签"></a>三、多媒体音频标签</h2><h3 id="1-多媒体标签有两个，分别是"><a href="#1-多媒体标签有两个，分别是" class="headerlink" title="1. 多媒体标签有两个，分别是"></a>1. 多媒体标签有两个，分别是</h3><ul>
<li>音频  – <code>audio</code></li>
<li>视频  – <code>video</code></li>
</ul>
<h3 id="2-audio-标签说明"><a href="#2-audio-标签说明" class="headerlink" title="2. audio 标签说明"></a>2. <code>audio</code> 标签说明</h3><ul>
<li>可以在不使用标签的情况下，也能够原生的支持音频格式文件的播放，</li>
<li>但是：播放格式是有限的</li>
</ul>
<h3 id="3-audio-支持的音频格式"><a href="#3-audio-支持的音频格式" class="headerlink" title="3. audio 支持的音频格式"></a>3. audio 支持的音频格式</h3><ul>
<li>audio 目前支持三种格式</li>
</ul>
<img width="80%" src="images\audio.png">

<h3 id="4-audio-的参数"><a href="#4-audio-的参数" class="headerlink" title="4. audio 的参数"></a>4. audio 的参数</h3><img width="80%" src="images\audiocanshu.png">

<h3 id="5-audio-代码演示"><a href="#5-audio-代码演示" class="headerlink" title="5. audio 代码演示"></a>5. audio 代码演示</h3><pre class=" language-css"><code class="language-css">&lt;body>
  &lt;!-- 注意：在 chrome 浏览器中已经禁用了 autoplay 属性 -->
  &lt;!-- &lt;audio src=<span class="token string">"./media/snow.mp3"</span> controls autoplay>&lt;/audio> -->

  &lt;!-- 
    因为不同浏览器支持不同的格式，所以我们采取的方案是这个音频准备多个文件
   -->
  &lt;audio controls>
    &lt;source src=<span class="token string">"./media/snow.mp3"</span> type=<span class="token string">"audio/mpeg"</span> />
  &lt;/audio>
&lt;/body></code></pre>
<h2 id="四、多媒体视频标签"><a href="#四、多媒体视频标签" class="headerlink" title="四、多媒体视频标签"></a>四、多媒体视频标签</h2><h3 id="1-video-视频标签"><a href="#1-video-视频标签" class="headerlink" title="1. video 视频标签"></a>1. video 视频标签</h3><ul>
<li>目前支持三种格式</li>
</ul>
<img width="80%" src="images\vedio.png">

<h3 id="2-语法格式"><a href="#2-语法格式" class="headerlink" title="2. 语法格式"></a>2. 语法格式</h3><pre class=" language-html"><code class="language-html">   <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>video</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>./media/video.mp4<span class="token punctuation">"</span></span> <span class="token attr-name">controls</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>controls<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>video</span><span class="token punctuation">></span></span></code></pre>
<h3 id="3-video-参数"><a href="#3-video-参数" class="headerlink" title="3. video 参数"></a>3. video 参数</h3><img width="80%" src="images\videocanshu.png">

<h3 id="4-video-代码演示"><a href="#4-video-代码演示" class="headerlink" title="4. video 代码演示"></a>4. video 代码演示</h3><pre class=" language-html"><code class="language-html">   <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">></span></span>
     <span class="token comment" spellcheck="true">&lt;!-- &lt;video src="./media/video.mp4" controls="controls">&lt;/video> --></span>

     <span class="token comment" spellcheck="true">&lt;!-- 谷歌浏览器禁用了自动播放功能，如果想自动播放，需要添加 muted 属性 --></span>
     <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>video</span> <span class="token attr-name">controls</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>controls<span class="token punctuation">"</span></span> <span class="token attr-name">autoplay</span> <span class="token attr-name">muted</span> <span class="token attr-name">loop</span> <span class="token attr-name">poster</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>./media/pig.jpg<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
       <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>source</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>./media/video.mp4<span class="token punctuation">"</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>video/mp4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
       <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>source</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>./media/video.ogg<span class="token punctuation">"</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>video/ogg<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
     <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>video</span><span class="token punctuation">></span></span>
   <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">></span></span></code></pre>
<h3 id="5-多媒体标签总结"><a href="#5-多媒体标签总结" class="headerlink" title="5. 多媒体标签总结"></a>5. 多媒体标签总结</h3><ul>
<li>音频标签与视频标签使用基本一致</li>
<li>多媒体标签在不同浏览器下情况不同，存在兼容性问题</li>
<li>谷歌浏览器把音频和视频标签的自动播放都禁止了</li>
<li>谷歌浏览器中视频添加 muted 标签可以自己播放</li>
<li>注意：重点记住使用方法以及自动播放即可，其他属性可以在使用时查找对应的手册</li>
</ul>
<h2 id="五、新增-input-标签"><a href="#五、新增-input-标签" class="headerlink" title="五、新增 input 标签"></a>五、新增 input 标签</h2><img width="80%" src="images\h5input.png">

<h2 id="六、新增表单属性"><a href="#六、新增表单属性" class="headerlink" title="六、新增表单属性"></a>六、新增表单属性</h2><img width="80%" src="images\newinput.png">

<h2 id="七、CSS3-属性选择器"><a href="#七、CSS3-属性选择器" class="headerlink" title="七、CSS3 属性选择器"></a>七、<code>CSS3</code> 属性选择器</h2><h3 id="1-什么是-CSS3"><a href="#1-什么是-CSS3" class="headerlink" title="1. 什么是 CSS3"></a>1. 什么是 <code>CSS3</code></h3><p>在 <code>CSS2</code> 的基础上拓展、新增的样式</p>
<h3 id="2-CSS3-发展现状"><a href="#2-CSS3-发展现状" class="headerlink" title="2. CSS3 发展现状"></a>2. <code>CSS3</code> 发展现状</h3><ul>
<li>移动端支持优于 <code>PC</code> 端</li>
<li><code>CSS3</code> 目前还草案，在不断改进中</li>
<li><code>CSS3</code> 相对 <code>H5</code>，应用非常广泛</li>
</ul>
<h3 id="3-属性选择器列表"><a href="#3-属性选择器列表" class="headerlink" title="3. 属性选择器列表"></a>3. 属性选择器列表</h3><img width="80%" src="images\attrcanshu.png">



<h3 id="4-属性选择器代码演示1"><a href="#4-属性选择器代码演示1" class="headerlink" title="4. 属性选择器代码演示1"></a>4. 属性选择器代码演示1</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">button </span><span class="token punctuation">{</span>
     <span class="token property">cursor</span><span class="token punctuation">:</span> pointer<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>
   <span class="token selector">button<span class="token attribute">[disabled]</span> </span><span class="token punctuation">{</span>
     <span class="token property">cursor</span><span class="token punctuation">:</span> default
   <span class="token punctuation">}</span></code></pre>
<h3 id="5-属性选择器代码演示2"><a href="#5-属性选择器代码演示2" class="headerlink" title="5. 属性选择器代码演示2"></a>5. 属性选择器代码演示2</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">input<span class="token attribute">[type=search]</span> </span><span class="token punctuation">{</span>
     <span class="token property">color</span><span class="token punctuation">:</span> skyblue<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">span<span class="token attribute">[class^=black]</span> </span><span class="token punctuation">{</span>
     <span class="token property">color</span><span class="token punctuation">:</span> lightgreen<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">span<span class="token attribute">[class$=black]</span> </span><span class="token punctuation">{</span>
     <span class="token property">color</span><span class="token punctuation">:</span> lightsalmon<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">span<span class="token attribute">[class*=black]</span> </span><span class="token punctuation">{</span>
     <span class="token property">color</span><span class="token punctuation">:</span> lightseagreen<span class="token punctuation">;</span>
   <span class="token punctuation">}</span></code></pre>
<h2 id="八、结构伪类选择器"><a href="#八、结构伪类选择器" class="headerlink" title="八、结构伪类选择器"></a>八、结构伪类选择器</h2><h3 id="1-属性列表"><a href="#1-属性列表" class="headerlink" title="1. 属性列表"></a>1. 属性列表</h3><img width="80%" src="images\jiegouweilei.png">

<h3 id="2-代码演示"><a href="#2-代码演示" class="headerlink" title="2. 代码演示"></a>2. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">ul li<span class="token pseudo-class">:first-child</span> </span><span class="token punctuation">{</span>
     <span class="token property">background-color</span><span class="token punctuation">:</span> lightseagreen<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">ul li<span class="token pseudo-class">:last-child</span> </span><span class="token punctuation">{</span>
     <span class="token property">background-color</span><span class="token punctuation">:</span> lightcoral<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">ul li<span class="token pseudo-class">:nth-child(3)</span> </span><span class="token punctuation">{</span>
     <span class="token property">background-color</span><span class="token punctuation">:</span> aqua<span class="token punctuation">;</span>
   <span class="token punctuation">}</span></code></pre>
<h2 id="九、nth-child-参数详解"><a href="#九、nth-child-参数详解" class="headerlink" title="九、nth-child 参数详解"></a>九、<code>nth-child</code> 参数详解</h2><h3 id="1-nth-child-详解"><a href="#1-nth-child-详解" class="headerlink" title="1. nth-child 详解"></a>1. nth-child 详解</h3><ul>
<li><p>注意：本质上就是选中第几个子元素</p>
</li>
<li><p>n 可以是数字、关键字、公式</p>
</li>
<li><p>n 如果是数字，就是选中第几个</p>
</li>
<li><p>常见的关键字有 <code>even</code> 偶数、<code>odd</code> 奇数</p>
</li>
<li><p>常见的公式如下(如果 n 是公式，则从 0 开始计算)</p>
</li>
<li><p>但是第 0 个元素或者超出了元素的个数会被忽略</p>
</li>
</ul>
<img width="80%" src="images\nthchildcanshu.png">

<h3 id="2-代码演示-1"><a href="#2-代码演示-1" class="headerlink" title="2. 代码演示"></a>2. 代码演示</h3><pre class=" language-css"><code class="language-css">   &lt;style>
     <span class="token comment" spellcheck="true">/* 偶数 */</span>
     <span class="token selector">ul li<span class="token pseudo-class">:nth-child(even)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> aquamarine<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>

     <span class="token comment" spellcheck="true">/* 奇数 */</span>
     <span class="token selector">ul li<span class="token pseudo-class">:nth-child(odd)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> blueviolet<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>

     <span class="token comment" spellcheck="true">/*n 是公式，从 0 开始计算 */</span>
     <span class="token selector">ul li<span class="token pseudo-class">:nth-child(n)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> lightcoral<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>

     <span class="token comment" spellcheck="true">/* 偶数 */</span>
     <span class="token selector">ul li<span class="token pseudo-class">:nth-child(2n)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> lightskyblue<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>

     <span class="token comment" spellcheck="true">/* 奇数 */</span>
     <span class="token selector">ul li<span class="token pseudo-class">:nth-child(2n + 1)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> lightsalmon<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>

     <span class="token comment" spellcheck="true">/* 选择第 0 5 10 15, 应该怎么选 */</span>
     <span class="token selector">ul li<span class="token pseudo-class">:nth-child(5n)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> orangered<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>

     <span class="token comment" spellcheck="true">/* n + 5 就是从第5个开始往后选择 */</span>
     <span class="token selector">ul li<span class="token pseudo-class">:nth-child(n + 5)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> peru<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>

     <span class="token comment" spellcheck="true">/* -n + 5 前五个 */</span>
     <span class="token selector">ul li<span class="token pseudo-class">:nth-child(-n + 5)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> tan<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>
   &lt;/style></code></pre>
<h2 id="十、nth-child-和-nt-of-type-的区别"><a href="#十、nth-child-和-nt-of-type-的区别" class="headerlink" title="十、nth-child 和  nt-of-type 的区别"></a>十、<code>nth-child</code> 和  <code>nt-of-type</code> 的区别</h2><h3 id="1-代码演示"><a href="#1-代码演示" class="headerlink" title="1. 代码演示"></a>1. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">&lt;style>
     div <span class="token pseudo-class">:nth-child(1)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> lightblue<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>

     <span class="token selector">div <span class="token pseudo-class">:nth-child(2)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> lightpink<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>

     <span class="token selector">div span<span class="token pseudo-class">:nth-of-type(2)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> lightseagreen<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>

     <span class="token selector">div span<span class="token pseudo-class">:nth-of-type(3)</span> </span><span class="token punctuation">{</span>
       <span class="token property">background-color</span><span class="token punctuation">:</span> <span class="token hexcode">#fff</span><span class="token punctuation">;</span>
     <span class="token punctuation">}</span>
   &lt;/style></code></pre>
<h3 id="2-区别"><a href="#2-区别" class="headerlink" title="2. 区别"></a>2. 区别</h3><ul>
<li><code>nth-child</code>  选择父元素里面的第几个子元素，不管是第几个类型</li>
<li><code>nt-of-type</code>  选择指定类型的元素</li>
</ul>
<h2 id="十一、伪元素选择器"><a href="#十一、伪元素选择器" class="headerlink" title="十一、伪元素选择器"></a>十一、伪元素选择器</h2><h3 id="1-伪类选择器"><a href="#1-伪类选择器" class="headerlink" title="1. 伪类选择器"></a>1. 伪类选择器</h3><img width="80%" src="images\weiyuansu.png">

<h3 id="2-伪类选择器注意事项"><a href="#2-伪类选择器注意事项" class="headerlink" title="2. 伪类选择器注意事项"></a>2. 伪类选择器注意事项</h3><ul>
<li><code>before</code> 和 <code>after</code> 必须有 <code>content</code> 属性</li>
<li><code>before</code> 在内容前面，<code>after</code> 在内容后面</li>
<li><code>before</code> 和 <code>after</code> 创建的是一个元素，但是属于行内元素</li>
<li>创建出来的元素在 <code>Dom</code> 中查找不到，所以称为伪元素</li>
<li>伪元素和标签选择器一样，权重为 1</li>
</ul>
<h3 id="3-代码演示"><a href="#3-代码演示" class="headerlink" title="3. 代码演示"></a>3. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">&lt;style>
       div </span><span class="token punctuation">{</span>
         <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">100</span>px<span class="token punctuation">;</span>
         <span class="token property">height</span><span class="token punctuation">:</span> <span class="token number">100</span>px<span class="token punctuation">;</span>
         <span class="token property">border</span><span class="token punctuation">:</span> <span class="token number">1</span>px solid lightcoral<span class="token punctuation">;</span>
       <span class="token punctuation">}</span>

       <span class="token selector">div<span class="token pseudo-element">::after</span>,
       div<span class="token pseudo-element">::before</span> </span><span class="token punctuation">{</span>
         <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">20</span>px<span class="token punctuation">;</span>
         <span class="token property">height</span><span class="token punctuation">:</span> <span class="token number">50</span>px<span class="token punctuation">;</span>
         <span class="token property">text-align</span><span class="token punctuation">:</span> center<span class="token punctuation">;</span>
         <span class="token property">display</span><span class="token punctuation">:</span> inline-block<span class="token punctuation">;</span>
       <span class="token punctuation">}</span>
       <span class="token selector">div<span class="token pseudo-element">::after</span> </span><span class="token punctuation">{</span>
         <span class="token property">content</span><span class="token punctuation">:</span> <span class="token string">'德'</span><span class="token punctuation">;</span>
         <span class="token property">background-color</span><span class="token punctuation">:</span> lightskyblue<span class="token punctuation">;</span>
       <span class="token punctuation">}</span>

       <span class="token selector">div<span class="token pseudo-element">::before</span> </span><span class="token punctuation">{</span>
         <span class="token property">content</span><span class="token punctuation">:</span> <span class="token string">'道'</span><span class="token punctuation">;</span>
         <span class="token property">background-color</span><span class="token punctuation">:</span> mediumaquamarine<span class="token punctuation">;</span>
       <span class="token punctuation">}</span>
     &lt;/style></code></pre>
<h3 id="4-案例-添加字体图标"><a href="#4-案例-添加字体图标" class="headerlink" title="4. 案例:添加字体图标"></a>4. 案例:添加字体图标</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">p </span><span class="token punctuation">{</span>
      <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">220</span>px<span class="token punctuation">;</span>
      <span class="token property">height</span><span class="token punctuation">:</span> <span class="token number">22</span>px<span class="token punctuation">;</span>
      <span class="token property">border</span><span class="token punctuation">:</span> <span class="token number">1</span>px solid lightseagreen<span class="token punctuation">;</span>
      <span class="token property">margin</span><span class="token punctuation">:</span> <span class="token number">60</span>px<span class="token punctuation">;</span>
      <span class="token property">position</span><span class="token punctuation">:</span> relative<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>
   <span class="token selector">p<span class="token pseudo-element">::after</span> </span><span class="token punctuation">{</span>
     <span class="token property">content</span><span class="token punctuation">:</span> <span class="token string">'\ea50'</span><span class="token punctuation">;</span>
     <span class="token property">font-family</span><span class="token punctuation">:</span> <span class="token string">'icomoon'</span><span class="token punctuation">;</span>
     <span class="token property">position</span><span class="token punctuation">:</span> absolute<span class="token punctuation">;</span>
     <span class="token property">top</span><span class="token punctuation">:</span> -<span class="token number">1</span>px<span class="token punctuation">;</span>
     <span class="token property">right</span><span class="token punctuation">:</span> <span class="token number">10</span>px<span class="token punctuation">;</span>
   <span class="token punctuation">}</span></code></pre>
<h2 id="十二、2D-转换之-translate"><a href="#十二、2D-转换之-translate" class="headerlink" title="十二、2D 转换之 translate"></a>十二、<code>2D</code> 转换之 <code>translate</code></h2><h3 id="1-2D-转换"><a href="#1-2D-转换" class="headerlink" title="1. 2D 转换"></a>1. <code>2D</code> 转换</h3><ul>
<li><p><code>2D</code> 转换是改变标签在二维平面上的位置和形状</p>
</li>
<li><p>移动： <code>translate</code></p>
</li>
<li><p>旋转： <code>rotate</code></p>
</li>
<li><p>缩放： <code>scale</code></p>
</li>
</ul>
<h3 id="2-translate-语法"><a href="#2-translate-语法" class="headerlink" title="2. translate 语法"></a>2. <code>translate</code> 语法</h3><ul>
<li><p>x 就是 x 轴上水平移动</p>
</li>
<li><p>y 就是 y 轴上水平移动</p>
<pre class=" language-css"><code class="language-css"><span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">translate</span><span class="token punctuation">(</span>x, y<span class="token punctuation">)</span>
<span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">translateX</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
<span class="token property">transfrom</span><span class="token punctuation">:</span> <span class="token function">translateY</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span></code></pre>
</li>
</ul>
<h3 id="3-重点知识点"><a href="#3-重点知识点" class="headerlink" title="3. 重点知识点"></a>3. 重点知识点</h3><ul>
<li><code>2D</code> 的移动主要是指 水平、垂直方向上的移动</li>
<li><code>translate</code> 最大的优点就是不影响其他元素的位置</li>
<li><code>translate</code> 中的100%单位，是相对于本身的宽度和高度来进行计算的</li>
<li>行内标签没有效果</li>
</ul>
<h3 id="4-代码演示"><a href="#4-代码演示" class="headerlink" title="4. 代码演示"></a>4. 代码演示</h3><pre class=" language-css"><code class="language-css"><span class="token selector">div </span><span class="token punctuation">{</span>
  <span class="token property">background-color</span><span class="token punctuation">:</span> lightseagreen<span class="token punctuation">;</span>
  <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">200</span>px<span class="token punctuation">;</span>
  <span class="token property">height</span><span class="token punctuation">:</span> <span class="token number">100</span>px<span class="token punctuation">;</span>
  <span class="token comment" spellcheck="true">/* 平移 */</span>
  <span class="token comment" spellcheck="true">/* 水平垂直移动 100px */</span>
  <span class="token comment" spellcheck="true">/* transform: translate(100px, 100px); */</span>

  <span class="token comment" spellcheck="true">/* 水平移动 100px */</span>
  <span class="token comment" spellcheck="true">/* transform: translate(100px, 0) */</span>

  <span class="token comment" spellcheck="true">/* 垂直移动 100px */</span>
  <span class="token comment" spellcheck="true">/* transform: translate(0, 100px) */</span>

  <span class="token comment" spellcheck="true">/* 水平移动 100px */</span>
  <span class="token comment" spellcheck="true">/* transform: translateX(100px); */</span>

  <span class="token comment" spellcheck="true">/* 垂直移动 100px */</span>
  <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">translateY</span><span class="token punctuation">(</span><span class="token number">100</span>px<span class="token punctuation">)</span>
<span class="token punctuation">}</span></code></pre>
<h2 id="十三、2D-转换-rotate"><a href="#十三、2D-转换-rotate" class="headerlink" title="十三、2D 转换 rotate"></a>十三、<code>2D 转换 rotate</code></h2><h3 id="1-rotate-旋转"><a href="#1-rotate-旋转" class="headerlink" title="1. rotate 旋转"></a>1. rotate 旋转</h3><ul>
<li><code>2D</code> 旋转指的是让元素在二维平面内顺时针或者逆时针旋转</li>
</ul>
<h3 id="2-rotate-语法"><a href="#2-rotate-语法" class="headerlink" title="2. rotate 语法"></a>2. <code>rotate</code> 语法</h3><pre class=" language-css"><code class="language-css">   <span class="token comment" spellcheck="true">/* 单位是：deg */</span>
   <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">rotate</span><span class="token punctuation">(</span>度数<span class="token punctuation">)</span> </code></pre>
<h3 id="3-重点知识点-1"><a href="#3-重点知识点-1" class="headerlink" title="3. 重点知识点"></a>3. 重点知识点</h3><ul>
<li><code>rotate</code> 里面跟度数，单位是 <code>deg</code></li>
<li>角度为正时，顺时针，角度为负时，逆时针</li>
<li>默认旋转的中心点是元素的中心点</li>
</ul>
<h3 id="4-代码演示-1"><a href="#4-代码演示-1" class="headerlink" title="4. 代码演示"></a>4. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">img<span class="token pseudo-class">:hover</span> </span><span class="token punctuation">{</span>
     <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">rotate</span><span class="token punctuation">(</span><span class="token number">360</span>deg<span class="token punctuation">)</span>
   <span class="token punctuation">}</span></code></pre>
<h2 id="十四、rotate"><a href="#十四、rotate" class="headerlink" title="十四、rotate"></a>十四、rotate</h2><blockquote>
<p>2d旋转指的是让元素在2维平面内顺时针旋转或者逆时针旋转</p>
</blockquote>
<p>使用步骤：</p>
<ol>
<li>给元素添加转换属性 <code>transform</code></li>
<li>属性值为 <code>rotate(角度)</code>  如 <code>transform:rotate(30deg)</code>  顺时针方向旋转<strong>30度</strong></li>
</ol>
<pre class=" language-css"><code class="language-css"><span class="token selector">div</span><span class="token punctuation">{</span>
      <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">rotate</span><span class="token punctuation">(</span><span class="token number">0</span>deg<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span></code></pre>
<h2 id="十五、设置元素旋转中心点-transform-origin"><a href="#十五、设置元素旋转中心点-transform-origin" class="headerlink" title="十五、设置元素旋转中心点(transform-origin)"></a>十五、设置元素旋转中心点(transform-origin)</h2><h3 id="1-transform-origin-基础语法"><a href="#1-transform-origin-基础语法" class="headerlink" title="1. transform-origin 基础语法"></a>1. <code>transform-origin</code> 基础语法</h3><pre class=" language-css"><code class="language-css">   <span class="token property">transform-origin</span><span class="token punctuation">:</span> x y<span class="token punctuation">;</span></code></pre>
<h3 id="2-重要知识点"><a href="#2-重要知识点" class="headerlink" title="2. 重要知识点"></a>2. 重要知识点</h3><ul>
<li>注意后面的参数 x 和 y 用空格隔开</li>
<li>x y 默认旋转的中心点是元素的中心 (50% 50%)，等价于 <code>center</code>  <code>center</code></li>
<li>还可以给 x y 设置像素或者方位名词(<code>top</code>、<code>bottom</code>、<code>left</code>、<code>right</code>、<code>center</code>)</li>
</ul>
<h2 id="十六、2D-转换之-scale"><a href="#十六、2D-转换之-scale" class="headerlink" title="十六、2D 转换之 scale"></a>十六、<code>2D</code> 转换之 <code>scale</code></h2><h3 id="1-scale-的作用"><a href="#1-scale-的作用" class="headerlink" title="1. scale 的作用"></a>1. <code>scale</code> 的作用</h3><p>用来控制元素的放大与缩小</p>
<h3 id="2-语法"><a href="#2-语法" class="headerlink" title="2. 语法"></a>2. 语法</h3><pre class=" language-css"><code class="language-css">   <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">scale</span><span class="token punctuation">(</span>x, y<span class="token punctuation">)</span></code></pre>
<h3 id="3-知识要点"><a href="#3-知识要点" class="headerlink" title="3. 知识要点"></a>3. 知识要点</h3><ul>
<li>注意，x 与 y 之间使用逗号进行分隔</li>
<li><code>transform: scale(1, 1)</code>: 宽高都放大一倍，相当于没有放大</li>
<li><code>transform: scale(2, 2)</code>: 宽和高都放大了二倍</li>
<li><code>transform: scale(2)</code>: 如果只写了一个参数，第二个参数就和第一个参数一致</li>
<li><code>transform:scale(0.5, 0.5)</code>: 缩小</li>
<li><code>scale</code> 最大的优势：可以设置转换中心点缩放，默认以中心点缩放，而且不影响其他盒子</li>
</ul>
<h3 id="4-代码演示-2"><a href="#4-代码演示-2" class="headerlink" title="4. 代码演示"></a>4. 代码演示</h3><pre class=" language-css"><code class="language-css">    <span class="token selector">div<span class="token pseudo-class">:hover</span> </span><span class="token punctuation">{</span>
        <span class="token comment" spellcheck="true">/* 注意，数字是倍数的含义，所以不需要加单位 */</span>
        <span class="token comment" spellcheck="true">/* transform: scale(2, 2) */</span>

        <span class="token comment" spellcheck="true">/* 实现等比缩放，同时修改宽与高 */</span>
        <span class="token comment" spellcheck="true">/* transform: scale(2) */</span>

        <span class="token comment" spellcheck="true">/* 小于 1 就等于缩放*/</span>
        <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">scale</span><span class="token punctuation">(</span><span class="token number">0.5</span>, <span class="token number">0.5</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span></code></pre>
<h2 id="十七、-2D-转换综合写法以及顺序问题"><a href="#十七、-2D-转换综合写法以及顺序问题" class="headerlink" title="十七、 2D 转换综合写法以及顺序问题"></a>十七、 <code>2D</code> 转换综合写法以及顺序问题</h2><h3 id="1-知识要点"><a href="#1-知识要点" class="headerlink" title="1. 知识要点"></a>1. 知识要点</h3><ul>
<li>同时使用多个转换，其格式为 <code>transform: translate() rotate() scale()</code></li>
<li>顺序会影响到转换的效果(先旋转会改变坐标轴方向)</li>
<li>但我们同时有位置或者其他属性的时候，要将位移放到最前面</li>
</ul>
<h3 id="2-代码演示-2"><a href="#2-代码演示-2" class="headerlink" title="2. 代码演示"></a>2. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">div<span class="token pseudo-class">:hover</span> </span><span class="token punctuation">{</span>
     <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">translate</span><span class="token punctuation">(</span><span class="token number">200</span>px, <span class="token number">0</span><span class="token punctuation">)</span> <span class="token function">rotate</span><span class="token punctuation">(</span><span class="token number">360</span>deg<span class="token punctuation">)</span> <span class="token function">scale</span><span class="token punctuation">(</span><span class="token number">1.2</span><span class="token punctuation">)</span>
   <span class="token punctuation">}</span></code></pre>
<h2 id="十八、-动画-animation"><a href="#十八、-动画-animation" class="headerlink" title="十八、 动画(animation)"></a>十八、 动画(animation)</h2><h3 id="1-什么是动画"><a href="#1-什么是动画" class="headerlink" title="1. 什么是动画"></a>1. 什么是动画</h3><p>动画是 <code>CSS3</code> 中最具颠覆性的特征之一，可通过设置多个节点来精确的控制一个或者一组动画，从而实现复杂的动画效果</p>
<h3 id="2-动画的基本使用"><a href="#2-动画的基本使用" class="headerlink" title="2. 动画的基本使用"></a>2. 动画的基本使用</h3><ul>
<li>先定义动画</li>
<li>在调用定义好的动画</li>
</ul>
<h3 id="3-语法格式-定义动画"><a href="#3-语法格式-定义动画" class="headerlink" title="3. 语法格式(定义动画)"></a>3. 语法格式(定义动画)</h3><pre class=" language-css"><code class="language-css">   <span class="token atrule"><span class="token rule">@keyframes</span> 动画名称</span> <span class="token punctuation">{</span>
       <span class="token selector">0% </span><span class="token punctuation">{</span>
           <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">100</span>px<span class="token punctuation">;</span>
       <span class="token punctuation">}</span>
       <span class="token selector">100% </span><span class="token punctuation">{</span>
           <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">200</span>px
       <span class="token punctuation">}</span>
   <span class="token punctuation">}</span></code></pre>
<h3 id="4-语法格式-使用动画"><a href="#4-语法格式-使用动画" class="headerlink" title="4. 语法格式(使用动画)"></a>4. 语法格式(使用动画)</h3><pre><code>   div {
       /* 调用动画 */
       animation-name: 动画名称;
        /* 持续时间 */
        animation-duration: 持续时间；
   }</code></pre><h3 id="5-动画序列"><a href="#5-动画序列" class="headerlink" title="5. 动画序列"></a>5. 动画序列</h3><ul>
<li>0% 是动画的开始，100 % 是动画的完成，这样的规则就是动画序列</li>
<li>在 @keyframs 中规定某项 CSS 样式，就由创建当前样式逐渐改为新样式的动画效果</li>
<li>动画是使元素从一个样式逐渐变化为另一个样式的效果，可以改变任意多的样式任意多的次数</li>
<li>用百分比来规定变化发生的时间，或用 <code>from</code> 和 <code>to</code>，等同于 0% 和 100%</li>
</ul>
<h3 id="6-代码演示"><a href="#6-代码演示" class="headerlink" title="6. 代码演示"></a>6. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">&lt;style>
       div </span><span class="token punctuation">{</span>
         <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">100</span>px<span class="token punctuation">;</span>
         <span class="token property">height</span><span class="token punctuation">:</span> <span class="token number">100</span>px<span class="token punctuation">;</span>
         <span class="token property">background-color</span><span class="token punctuation">:</span> aquamarine<span class="token punctuation">;</span>
         <span class="token property">animation-name</span><span class="token punctuation">:</span> move<span class="token punctuation">;</span>
         <span class="token property">animation-duration</span><span class="token punctuation">:</span> <span class="token number">0.5</span>s<span class="token punctuation">;</span>
       <span class="token punctuation">}</span>

       <span class="token atrule"><span class="token rule">@keyframes</span> move</span><span class="token punctuation">{</span>
         <span class="token selector">0% </span><span class="token punctuation">{</span>
           <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">translate</span><span class="token punctuation">(</span><span class="token number">0</span>px<span class="token punctuation">)</span>
         <span class="token punctuation">}</span>
         <span class="token selector">100% </span><span class="token punctuation">{</span>
           <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">translate</span><span class="token punctuation">(</span><span class="token number">500</span>px, <span class="token number">0</span><span class="token punctuation">)</span>
         <span class="token punctuation">}</span>
       <span class="token punctuation">}</span>
     &lt;/style></code></pre>
<h2 id="十九、动画常见属性"><a href="#十九、动画常见属性" class="headerlink" title="十九、动画常见属性"></a>十九、动画常见属性</h2><h3 id="1-常见的属性"><a href="#1-常见的属性" class="headerlink" title="1. 常见的属性"></a>1. 常见的属性</h3><img width="80%" src="images\animationcanshu.png">

<p>   ​</p>
<h3 id="2-代码演示-3"><a href="#2-代码演示-3" class="headerlink" title="2. 代码演示"></a>2. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">div </span><span class="token punctuation">{</span>
     <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">100</span>px<span class="token punctuation">;</span>
     <span class="token property">height</span><span class="token punctuation">:</span> <span class="token number">100</span>px<span class="token punctuation">;</span>
     <span class="token property">background-color</span><span class="token punctuation">:</span> aquamarine<span class="token punctuation">;</span>
     <span class="token comment" spellcheck="true">/* 动画名称 */</span>
     <span class="token property">animation-name</span><span class="token punctuation">:</span> move<span class="token punctuation">;</span>
     <span class="token comment" spellcheck="true">/* 动画花费时长 */</span>
     <span class="token property">animation-duration</span><span class="token punctuation">:</span> <span class="token number">2</span>s<span class="token punctuation">;</span>
     <span class="token comment" spellcheck="true">/* 动画速度曲线 */</span>
     <span class="token property">animation-timing-function</span><span class="token punctuation">:</span> ease-in-out<span class="token punctuation">;</span>
     <span class="token comment" spellcheck="true">/* 动画等待多长时间执行 */</span>
     <span class="token property">animation-delay</span><span class="token punctuation">:</span> <span class="token number">2</span>s<span class="token punctuation">;</span>
     <span class="token comment" spellcheck="true">/* 规定动画播放次数 infinite: 无限循环 */</span>
     <span class="token property">animation-iteration-count</span><span class="token punctuation">:</span> infinite<span class="token punctuation">;</span>
     <span class="token comment" spellcheck="true">/* 是否逆行播放 */</span>
     <span class="token property">animation-direction</span><span class="token punctuation">:</span> alternate<span class="token punctuation">;</span>
     <span class="token comment" spellcheck="true">/* 动画结束之后的状态 */</span>
     <span class="token property">animation-fill-mode</span><span class="token punctuation">:</span> forwards<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">div<span class="token pseudo-class">:hover</span> </span><span class="token punctuation">{</span>
     <span class="token comment" spellcheck="true">/* 规定动画是否暂停或者播放 */</span>
     <span class="token property">animation-play-state</span><span class="token punctuation">:</span> paused<span class="token punctuation">;</span>
   <span class="token punctuation">}</span></code></pre>
<h2 id="二十、-动画简写方式"><a href="#二十、-动画简写方式" class="headerlink" title="二十、 动画简写方式"></a>二十、 动画简写方式</h2><h3 id="1-动画简写方式"><a href="#1-动画简写方式" class="headerlink" title="1. 动画简写方式"></a>1. 动画简写方式</h3><pre class=" language-css"><code class="language-css">   <span class="token comment" spellcheck="true">/* animation: 动画名称 持续时间 运动曲线 何时开始 播放次数 是否反方向 起始与结束状态 */</span>
   <span class="token property">animation</span><span class="token punctuation">:</span> name duration timing-function delay iteration-count direction fill-mode</code></pre>
<h3 id="2-知识要点"><a href="#2-知识要点" class="headerlink" title="2. 知识要点"></a>2. 知识要点</h3><ul>
<li>简写属性里面不包含 <code>animation-paly-state</code></li>
<li>暂停动画 <code>animation-paly-state: paused</code>; 经常和鼠标经过等其他配合使用</li>
<li>要想动画走回来，而不是直接调回来：<code>animation-direction: alternate</code></li>
<li>盒子动画结束后，停在结束位置：<code>animation-fill-mode: forwards</code> </li>
</ul>
<h3 id="3-代码演示-1"><a href="#3-代码演示-1" class="headerlink" title="3. 代码演示"></a>3. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token property">animation</span><span class="token punctuation">:</span> move <span class="token number">2</span>s linear <span class="token number">1</span>s infinite alternate forwards<span class="token punctuation">;</span></code></pre>
<h2 id="二十一、速度曲线细节"><a href="#二十一、速度曲线细节" class="headerlink" title="二十一、速度曲线细节"></a>二十一、速度曲线细节</h2><h3 id="1-速度曲线细节"><a href="#1-速度曲线细节" class="headerlink" title="1. 速度曲线细节"></a>1. 速度曲线细节</h3><ul>
<li><code>animation-timing-function</code>: 规定动画的速度曲线，默认是<code>ease</code></li>
</ul>
<img width="80%" src="images\steps.png">

<h3 id="2-代码演示-4"><a href="#2-代码演示-4" class="headerlink" title="2. 代码演示"></a>2. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">div </span><span class="token punctuation">{</span>
     <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">0</span>px<span class="token punctuation">;</span>
     <span class="token property">height</span><span class="token punctuation">:</span> <span class="token number">50</span>px<span class="token punctuation">;</span>
     <span class="token property">line-height</span><span class="token punctuation">:</span> <span class="token number">50</span>px<span class="token punctuation">;</span>
     <span class="token property">white-space</span><span class="token punctuation">:</span> nowrap<span class="token punctuation">;</span>
     <span class="token property">overflow</span><span class="token punctuation">:</span> hidden<span class="token punctuation">;</span>
     <span class="token property">background-color</span><span class="token punctuation">:</span> aquamarine<span class="token punctuation">;</span>
     <span class="token property">animation</span><span class="token punctuation">:</span> move <span class="token number">4</span>s <span class="token function">steps</span><span class="token punctuation">(</span><span class="token number">24</span><span class="token punctuation">)</span> forwards<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token atrule"><span class="token rule">@keyframes</span> move</span> <span class="token punctuation">{</span>
     <span class="token selector">0% </span><span class="token punctuation">{</span>
       <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">0</span>px<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>

     <span class="token selector">100% </span><span class="token punctuation">{</span>
       <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">480</span>px<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>
   <span class="token punctuation">}</span></code></pre>
<h3 id="3-案例：奔跑的熊大"><a href="#3-案例：奔跑的熊大" class="headerlink" title="3. 案例：奔跑的熊大"></a>3. 案例：奔跑的熊大</h3><pre class=" language-html"><code class="language-html"><span class="token doctype">&lt;!DOCTYPE html></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>html</span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>en<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">charset</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>UTF-8<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>viewport<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>width<span class="token punctuation">=</span>device-width, initial-scale<span class="token punctuation">=</span>1.0<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">http-equiv</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>X-UA-Compatible<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>ie<span class="token punctuation">=</span>edge<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>title</span><span class="token punctuation">></span></span>Document<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>title</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span><span class="token punctuation">></span></span><span class="token style language-css">
        <span class="token selector">body </span><span class="token punctuation">{</span>
            <span class="token property">background-color</span><span class="token punctuation">:</span> <span class="token hexcode">#ccc</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>      
        <span class="token selector">div </span><span class="token punctuation">{</span>
            <span class="token property">position</span><span class="token punctuation">:</span> absolute<span class="token punctuation">;</span>
            <span class="token property">width</span><span class="token punctuation">:</span> <span class="token number">200</span>px<span class="token punctuation">;</span>
            <span class="token property">height</span><span class="token punctuation">:</span> <span class="token number">100</span>px<span class="token punctuation">;</span>
            <span class="token property">background</span><span class="token punctuation">:</span> <span class="token url">url(media/bear.png)</span> no-repeat<span class="token punctuation">;</span>
            <span class="token comment" spellcheck="true">/* 我们元素可以添加多个动画， 用逗号分隔 */</span>
            <span class="token property">animation</span><span class="token punctuation">:</span> bear <span class="token number">.4</span>s <span class="token function">steps</span><span class="token punctuation">(</span><span class="token number">8</span><span class="token punctuation">)</span> infinite, move <span class="token number">3</span>s forwards<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

        <span class="token atrule"><span class="token rule">@keyframes</span> bear</span> <span class="token punctuation">{</span>
            <span class="token selector">0% </span><span class="token punctuation">{</span>
                <span class="token property">background-position</span><span class="token punctuation">:</span> <span class="token number">0</span> <span class="token number">0</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token selector">100% </span><span class="token punctuation">{</span>
                <span class="token property">background-position</span><span class="token punctuation">:</span> -<span class="token number">1600</span>px <span class="token number">0</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>

        <span class="token atrule"><span class="token rule">@keyframes</span> move</span> <span class="token punctuation">{</span>
            <span class="token selector">0% </span><span class="token punctuation">{</span>
                <span class="token property">left</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token selector">100% </span><span class="token punctuation">{</span>
                <span class="token property">left</span><span class="token punctuation">:</span> <span class="token number">50%</span><span class="token punctuation">;</span>
                <span class="token comment" spellcheck="true">/* margin-left: -100px; */</span>
                <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">translateX</span><span class="token punctuation">(</span>-<span class="token number">50%</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    </span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">></span></span>

<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">></span></span>

<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>html</span><span class="token punctuation">></span></span></code></pre>
<h2 id="二十二、-认识-3D-转换"><a href="#二十二、-认识-3D-转换" class="headerlink" title="二十二、 认识 3D 转换"></a>二十二、 认识 <code>3D</code> 转换</h2><h3 id="1-3D-的特点"><a href="#1-3D-的特点" class="headerlink" title="1. 3D 的特点"></a>1. <code>3D</code> 的特点</h3><ul>
<li><p>近大远小</p>
</li>
<li><p>物体和面遮挡不可见</p>
<h3 id="2-三维坐标系"><a href="#2-三维坐标系" class="headerlink" title="2. 三维坐标系"></a>2. 三维坐标系</h3></li>
<li><p>x 轴：水平向右  – <strong>注意：x 轴右边是正值，左边是负值</strong></p>
</li>
<li><p>y 轴：垂直向下  – <strong>注意：y 轴下面是正值，上面是负值</strong></p>
</li>
<li><p>z 轴：垂直屏幕  –  <strong>注意：往外边的是正值，往里面的是负值</strong></p>
</li>
</ul>
<img width="80%" src="images\sanwei.png">

<h2 id="二十三、3D-转换"><a href="#二十三、3D-转换" class="headerlink" title="二十三、3D 转换"></a>二十三、<code>3D</code> 转换</h2><h3 id="1-3D-转换知识要点"><a href="#1-3D-转换知识要点" class="headerlink" title="1. 3D 转换知识要点"></a>1. <code>3D</code> 转换知识要点</h3><ul>
<li><code>3D</code> 位移：<code>translate3d(x, y, z)</code></li>
<li><code>3D</code> 旋转：<code>rotate3d(x, y, z)</code></li>
<li>透视：<code>perspctive</code></li>
<li><code>3D</code>呈现 <code>transfrom-style</code></li>
</ul>
<h3 id="2-3D-移动-translate3d"><a href="#2-3D-移动-translate3d" class="headerlink" title="2. 3D 移动 translate3d"></a>2. <code>3D</code> 移动 <code>translate3d</code></h3><ul>
<li><code>3D</code> 移动就是在 <code>2D</code> 移动的基础上多加了一个可以移动的方向，就是 z 轴方向</li>
<li><code>transform: translateX(100px)</code>：仅仅是在 x 轴上移动</li>
<li><code>transform: translateY(100px)</code>：仅仅是在 y 轴上移动</li>
<li><code>transform: translateZ(100px)</code>：仅仅是在 z 轴上移动</li>
<li><code>transform: translate3d(x, y, z)</code>：其中x、y、z 分别指要移动的轴的方向的距离</li>
<li><strong>注意：x, y, z 对应的值不能省略，不需要填写用 0 进行填充</strong></li>
</ul>
<h3 id="3-语法"><a href="#3-语法" class="headerlink" title="3. 语法"></a>3. 语法</h3><pre class=" language-css"><code class="language-css">    <span class="token property">transform</span><span class="token punctuation">:</span> translate<span class="token number">3</span><span class="token function">d</span><span class="token punctuation">(</span>x, y, z<span class="token punctuation">)</span></code></pre>
<h3 id="4-代码演示-3"><a href="#4-代码演示-3" class="headerlink" title="4. 代码演示"></a>4. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token property">transform</span><span class="token punctuation">:</span> translate<span class="token number">3</span><span class="token function">d</span><span class="token punctuation">(</span><span class="token number">100</span>px, <span class="token number">100</span>px, <span class="token number">100</span>px<span class="token punctuation">)</span>
   <span class="token comment" spellcheck="true">/* 注意：x, y, z 对应的值不能省略，不需要填写用 0 进行填充 */</span>
   <span class="token property">transform</span><span class="token punctuation">:</span> translate<span class="token number">3</span><span class="token function">d</span><span class="token punctuation">(</span><span class="token number">100</span>px, <span class="token number">100</span>px, <span class="token number">0</span><span class="token punctuation">)</span></code></pre>
<h2 id="二十四、透视-perspective"><a href="#二十四、透视-perspective" class="headerlink" title="二十四、透视 perspective"></a>二十四、透视 <code>perspective</code></h2><h3 id="1-知识点讲解"><a href="#1-知识点讲解" class="headerlink" title="1. 知识点讲解"></a>1. 知识点讲解</h3><ul>
<li>如果想要网页产生 <code>3D</code> 效果需要透视(理解成 <code>3D</code> 物体投影的 <code>2D</code> 平面上)</li>
<li>实际上模仿人类的视觉位置，可视为安排一直眼睛去看</li>
<li>透视也称为视距，所谓的视距就是人的眼睛到屏幕的距离</li>
<li>距离视觉点越近的在电脑平面成像越大，越远成像越小</li>
<li>透视的单位是像素</li>
</ul>
<h3 id="2-知识要点-1"><a href="#2-知识要点-1" class="headerlink" title="2. 知识要点"></a>2. 知识要点</h3><ul>
<li><p><strong>透视需要写在被视察元素的父盒子上面</strong></p>
</li>
<li><p>注意下方图片</p>
<ul>
<li><p>d：就是视距，视距就是指人的眼睛到屏幕的距离</p>
</li>
<li><p>z：就是 z 轴，z 轴越大(正值)，我们看到的物体就越大</p>
</li>
</ul>
</li>
</ul>
<img width="80%" src="images\perspective.png">

<p>   ​            </p>
<h3 id="3-代码演示-2"><a href="#3-代码演示-2" class="headerlink" title="3. 代码演示"></a>3. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">body </span><span class="token punctuation">{</span>
     <span class="token property">perspective</span><span class="token punctuation">:</span> <span class="token number">1000</span>px<span class="token punctuation">;</span>
   <span class="token punctuation">}</span></code></pre>
<h2 id="二十五、-translateZ"><a href="#二十五、-translateZ" class="headerlink" title="二十五、 translateZ"></a>二十五、 <code>translateZ</code></h2><h3 id="1-translateZ-与-perspecitve-的区别"><a href="#1-translateZ-与-perspecitve-的区别" class="headerlink" title="1. translateZ 与 perspecitve 的区别"></a>1. <code>translateZ</code> 与 <code>perspecitve</code> 的区别</h3><p><code>perspecitve</code> 给父级进行设置，<code>translateZ</code> 给 子元素进行设置不同的大小</p>
<h2 id="二十六、3D-旋转rotateX"><a href="#二十六、3D-旋转rotateX" class="headerlink" title="二十六、3D 旋转rotateX"></a>二十六、<code>3D</code> 旋转<code>rotateX</code></h2><blockquote>
<p>3D 旋转指可以让元素在三维平面内沿着 x 轴、y 轴、z 轴 或者自定义轴进行旋转</p>
</blockquote>
<h3 id="1-语法"><a href="#1-语法" class="headerlink" title="1. 语法"></a>1. 语法</h3><ul>
<li><code>transform: rotateX(45deg)</code> – 沿着 x 轴正方向旋转 45 度</li>
<li><code>transform: rotateY(45deg)</code> – 沿着 y 轴正方向旋转 45 度</li>
<li><code>transform: rotateZ(45deg)</code> – 沿着 z 轴正方向旋转 45 度</li>
<li><code>transform: rotate3d(x, y, z, 45deg)</code> – 沿着自定义轴旋转 45 deg 为角度</li>
</ul>
<h3 id="2-代码案例"><a href="#2-代码案例" class="headerlink" title="2. 代码案例"></a>2. 代码案例</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">div </span><span class="token punctuation">{</span>
     <span class="token property">perspective</span><span class="token punctuation">:</span> <span class="token number">300</span>px<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">img </span><span class="token punctuation">{</span>
     <span class="token property">display</span><span class="token punctuation">:</span> block<span class="token punctuation">;</span>
     <span class="token property">margin</span><span class="token punctuation">:</span> <span class="token number">100</span>px auto<span class="token punctuation">;</span>
     <span class="token property">transition</span><span class="token punctuation">:</span> all <span class="token number">1</span>s<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">img<span class="token pseudo-class">:hover</span> </span><span class="token punctuation">{</span>
     <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">rotateX</span><span class="token punctuation">(</span>-<span class="token number">45</span>deg<span class="token punctuation">)</span>
   <span class="token punctuation">}</span></code></pre>
<h3 id="3-左手准则"><a href="#3-左手准则" class="headerlink" title="3. 左手准则"></a>3. 左手准则</h3><ul>
<li><p>左手的手拇指指向 x 轴的正方向</p>
</li>
<li><p>其余手指的弯曲方向就是该元素沿着 x 轴旋转的方向</p>
</li>
</ul>
<img width="80%" src="images\rotateX.png">

<p>​              </p>
<h2 id="二十七、3D-旋转-rotateY"><a href="#二十七、3D-旋转-rotateY" class="headerlink" title="二十七、3D 旋转 rotateY"></a>二十七、<code>3D</code> 旋转 <code>rotateY</code></h2><h3 id="1-代码演示-1"><a href="#1-代码演示-1" class="headerlink" title="1. 代码演示"></a>1. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">div </span><span class="token punctuation">{</span>
     <span class="token property">perspective</span><span class="token punctuation">:</span> <span class="token number">500</span>px<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">img </span><span class="token punctuation">{</span>
     <span class="token property">display</span><span class="token punctuation">:</span> block<span class="token punctuation">;</span>
     <span class="token property">margin</span><span class="token punctuation">:</span> <span class="token number">100</span>px auto<span class="token punctuation">;</span>
     <span class="token property">transition</span><span class="token punctuation">:</span> all <span class="token number">1</span>s<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">img<span class="token pseudo-class">:hover</span> </span><span class="token punctuation">{</span>
     <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">rotateY</span><span class="token punctuation">(</span><span class="token number">180</span>deg<span class="token punctuation">)</span>
   <span class="token punctuation">}</span></code></pre>
<h3 id="2-左手准则"><a href="#2-左手准则" class="headerlink" title="2. 左手准则"></a>2. 左手准则</h3><ul>
<li><p>左手的拇指指向 y 轴的正方向</p>
</li>
<li><p>其余的手指弯曲方向就是该元素沿着 y 轴旋转的方向(正值)</p>
</li>
</ul>
<img width="80%" src="images\rotateY.png">

<pre><code> ​</code></pre><h2 id="二十八、-3D-旋转-rotateZ"><a href="#二十八、-3D-旋转-rotateZ" class="headerlink" title="二十八、 3D 旋转 rotateZ"></a>二十八、 <code>3D</code> 旋转 <code>rotateZ</code></h2><h3 id="1-代码演示-2"><a href="#1-代码演示-2" class="headerlink" title="1. 代码演示"></a>1. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">div </span><span class="token punctuation">{</span>
     <span class="token property">perspective</span><span class="token punctuation">:</span> <span class="token number">500</span>px<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">img </span><span class="token punctuation">{</span>
     <span class="token property">display</span><span class="token punctuation">:</span> block<span class="token punctuation">;</span>
     <span class="token property">margin</span><span class="token punctuation">:</span> <span class="token number">100</span>px auto<span class="token punctuation">;</span>
     <span class="token property">transition</span><span class="token punctuation">:</span> all <span class="token number">1</span>s<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">img<span class="token pseudo-class">:hover</span> </span><span class="token punctuation">{</span>
     <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">rotateZ</span><span class="token punctuation">(</span><span class="token number">180</span>deg<span class="token punctuation">)</span>
   <span class="token punctuation">}</span></code></pre>
<h3 id="2-rotate3d"><a href="#2-rotate3d" class="headerlink" title="2. rotate3d"></a>2. <code>rotate3d</code></h3><ul>
<li><code>transform: rotate3d(x, y, z, deg)</code> – 沿着自定义轴旋转 deg 为角度</li>
<li>x, y, z 表示旋转轴的矢量，是标识你是否希望沿着该轴进行旋转，最后一个标识旋转的角度<ul>
<li><code>transform: rotate3d(1, 1, 0, 180deg)</code> – 沿着对角线旋转 45deg</li>
<li><code>transform: rotate3d(1, 0, 0, 180deg)</code> – 沿着 x 轴旋转 45deg</li>
</ul>
</li>
</ul>
<h3 id="3-代码演示-3"><a href="#3-代码演示-3" class="headerlink" title="3. 代码演示"></a>3. 代码演示</h3><pre class=" language-css"><code class="language-css">   <span class="token selector">div </span><span class="token punctuation">{</span>
     <span class="token property">perspective</span><span class="token punctuation">:</span> <span class="token number">500</span>px<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">img </span><span class="token punctuation">{</span>
     <span class="token property">display</span><span class="token punctuation">:</span> block<span class="token punctuation">;</span>
     <span class="token property">margin</span><span class="token punctuation">:</span> <span class="token number">100</span>px auto<span class="token punctuation">;</span>
     <span class="token property">transition</span><span class="token punctuation">:</span> all <span class="token number">1</span>s<span class="token punctuation">;</span>
   <span class="token punctuation">}</span>

   <span class="token selector">img<span class="token pseudo-class">:hover</span> </span><span class="token punctuation">{</span>
     <span class="token property">transform</span><span class="token punctuation">:</span> rotate<span class="token number">3</span><span class="token function">d</span><span class="token punctuation">(</span><span class="token number">1</span>, <span class="token number">1</span>, <span class="token number">0</span>, <span class="token number">180</span>deg<span class="token punctuation">)</span>
   <span class="token punctuation">}</span></code></pre>
<h2 id="二十九、3D-呈现-transform-style"><a href="#二十九、3D-呈现-transform-style" class="headerlink" title="二十九、3D 呈现 transform-style"></a>二十九、<code>3D</code> 呈现 <code>transform-style</code></h2><ul>
<li>控制子元素是否开启三维立体环境</li>
<li><code>transform-style: flat</code>  代表子元素不开启 <code>3D</code> 立体空间，默认的</li>
<li><code>transform-style: preserve-3d</code> 子元素开启立体空间</li>
<li>代码写给父级，但是影响的是子盒子</li>
</ul>
<script>
        document.querySelectorAll('.github-emoji')
          .forEach(el => {
            if (!el.dataset.src) { return; }
            const img = document.createElement('img');
            img.style = 'display:none !important;';
            img.src = el.dataset.src;
            img.addEventListener('error', () => {
              img.remove();
              el.style.color = 'inherit';
              el.style.backgroundImage = 'none';
              el.style.background = 'none';
            });
            img.addEventListener('load', () => {
              img.remove();
            });
            document.body.appendChild(img);
          });
      </script>
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://shenzhaoliang.gitee.io" rel="external nofollow noreferrer">小沈</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://shenzhaoliang.gitee.io/xiaoshensay/2019/05/01/html5css3/">https://shenzhaoliang.gitee.io/xiaoshensay/2019/05/01/html5css3/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="https://shenzhaoliang.gitee.io" target="_blank">小沈</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/xiaoshensay/tags/HTML5/">
                                    <span class="chip bg-color">HTML5</span>
                                </a>
                            
                                <a href="/xiaoshensay/tags/CSS3/">
                                    <span class="chip bg-color">CSS3</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    
    <div class="social-share" data-sites="qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>
            
        </div>
    </div>

    
        <link rel="stylesheet" href="/libs/gitalk/gitalk.css">
<link rel="stylesheet" href="/css/my-gitalk.css">

<div class="card gitalk-card" data-aos="fade-up">
    <div class="comment_headling" style="font-size: 20px; font-weight: 700; position: relative; left: 20px; top: 15px; padding-bottom: 5px;">
        <i class="fas fa-comments fa-fw" aria-hidden="true"></i>
        <span>评论</span>
    </div>
    <div id="gitalk-container" class="card-content"></div>
</div>

<script src="/libs/gitalk/gitalk.min.js"></script>
<script>
    let gitalk = new Gitalk({
        clientID: '',
        clientSecret: '',
        repo: '',
        owner: '',
        admin: null,
        id: '2019-05-01T17-41-54',
        distractionFreeMode: false  // Facebook-like distraction free mode
    });

    gitalk.render('gitalk-container');
</script>
    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/xiaoshensay/2019/05/08/yi-dong-duan-chang-jian-bu-ju/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/16.jpg" class="responsive-img" alt="移动端常见布局">
                        
                        <span class="card-title">移动端常见布局</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            为了适应市场及用户的转变，越来越多的服务从PC端转向移动端，移动端页面布局也就成为前端开发工程师必须掌握的技能。
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2019-05-08
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/xiaoshensay/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA/" class="post-category">
                                    计算机
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/xiaoshensay/tags/HTML5/">
                        <span class="chip bg-color">HTML5</span>
                    </a>
                    
                    <a href="/xiaoshensay/tags/CSS3/">
                        <span class="chip bg-color">CSS3</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/xiaoshensay/2018/03/05/html-standard/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/0.jpg" class="responsive-img" alt="HTML代码规范">
                        
                        <span class="card-title">HTML代码规范</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            在使用HTML的过程中，使用规范化的代码能够更加方便你的运用与阅读。旨在增强团队开发协作、提高代码质量和打造开发基石的编码规范。
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2018-03-05
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/xiaoshensay/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA/" class="post-category">
                                    计算机
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/xiaoshensay/tags/html/">
                        <span class="chip bg-color">html</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


<!-- 代码块折行 -->

<style type="text/css">
code[class*="language-"], pre[class*="language-"] { white-space: pre !important; }
</style>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('3'),
            headingSelector: 'h1, h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h1, h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>



    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/libs/aplayer/APlayer.min.css">
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="955411580"
                   fixed='true'
                   autoplay='false'
                   theme:='#42b983'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.7'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/libs/aplayer/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>

    
    <div class="container row center-align" style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            <span id="year">2019</span>
            <a href="https://shenzhaoliang.gitee.io" target="_blank">小沈</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                class="white-color">31.5k</span>&nbsp;字
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/stszl" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:stszl@sina.cn" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=409178030" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 409178030" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/xiaoshensay/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
$(function () {
    searchFunc("/xiaoshensay/" + "search.xml", 'searchInput', 'searchResult');
});
</script>
    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    <!-- Global site tag (gtag.js) - Google Analytics -->


    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    

    

    
    
    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
